1. Field of the Invention
The present invention relates generally to a differential input comparator, and more particularly to a differential input comparator with double sided hysteresis and which is capable of operating independently of a DC voltage supply level.
2. Description of the Background Art
Noise detection is very important in electronics, as known noise in a circuit may be removed, attenuated, or at least compensated for. One area in particular where electromagnetic noise is a problem is in a motor vehicle. The vehicle generates on-board electricity through use of an alternator. The alternator generates an alternating current (AC) type of voltage. However, almost all vehicles operate on direct current (DC) due to the need to store the generated electricity in a battery. Therefore, the alternating current produced by the alternator must be rectified to convert it into direct current. A voltage regulator receives the direct current and monitors voltage levels available to the vehicle.
The rectification does not remove all of the AC components from the generated electrical current. A remaining noise signal, an artifact of the originally produced AC voltage, rides on top of the rectified DC voltage signal.
If the frequency of the AC noise is known, it can be more easily filtered. The AC noise also may be used for other purposes. One beneficial use of the AC noise is the detection of the noise frequency and therefore the RPM of the alternator. The alternator's rotational speed may be used for various purposes. For example, the alternator speed may be used to keep the alternator switched off during engine starting or during periods of heavy engine load. A zero alternator speed may indicate when the alternator drive belt is broken. And, the alternator speed may be inputted to a voltage regulator to compare the output voltage to the actual alternator speed and give a warning when the alternator output voltage is too low.
The AC noise signal frequency is detected by using a differential detector and comparator to convert the AC signal into a square wave output. A frequency counter receives the square wave output and counts the square waves in a certain period of time to obtain a frequency. The square waves are produced by comparing the AC signal with a delayed version of itself. This is particularly common for cases where two "different" signals from the same source exist, as in the case of two phase signals being output from either an alternator or the ends of an inductive pickup coil.
A problem in the prior art is that due to the noisy nature of the AC signal, the conventional differential comparator cannot simply compare the two signals. Noise (or an invalid signal) can easily cause a differential comparator to improperly change state. The presence of an extra pulse or pulses caused by noise or waveform impurity can generate a false "high frequency" measurement, resulting in an erroneous change in an alternator operating mode.
A prior art approach to making the frequency detection more accurate and reliable is through addition of an offset or hysteresis to the comparison. In the prior art, a differential comparator may attempt to address the problem through a positive feedback resistor that generates hysteresis. For example, if the comparator is configured to output a logic one when input B is greater than input A, the addition of a voltage offset or hysteresis means that input B must exceed input A by the offset amount before the comparator outputs a logic one.
FIG. 1 shows a conventional differential comparator 100. The differential comparator 100 carries out the differential detection using a comparator stage 104. The comparator stage 104 is preceded by an offset stage 107 that adds an offset to one input signal via a resistor RPH1 and a current source M.sub.8 that provides a current I.sub.M8. Due to the offset stage 107, the offset voltage level is (RPH1+RPH1A)*I.sub.M8 (V=IR as given by Ohm's Law), plus a voltage component from the output resistance of M.sub.44. The voltage component from the output resistance of M.sub.44 is balanced by the output resistance of M.sub.45 due to the current I.sub.M9 (here I.sub.M9 =I.sub.M8). Therefore, an input signal at PHIN2 will have to go above an input signal at PHIN1 by this offset amount before the state of the comparator stage 104 is changed.
FIG. 2 shows a differential comparator output B&gt;A when the comparator has a single offset. The comparator output is a logic one only when input B is greater than input A by the offset amount. Therefore, small ripples in inputs A or B will not affect the comparator output.
FIG. 3, however, shows a comparator double output drawback in the conventional art. In this example, the comparator 100 outputs a logic one when input A is greater than input B. At time .cndot..sub.2 the noise on input A causes two comparator output pulses where there should be only one. This is caused by the noise on input A, wherein input A momentarily drops below the offset value, causing the related art comparator output to momentarily drop to an incorrect logic zero value. It is therefore desirable to require a first input to exceed a second input by an offset amount in going both above and below the second input.
An additional drawback of the conventional differential comparator 100 is that, since the input DC voltage level is not fixed, a voltage-controlled hysteresis level will cause the hysteresis level to vary with the DC voltage operating point, lessening the benefit of the hysteresis as the DC voltage drops (i.e., if the DC voltage drops, the amount of hysteresis drops, increasing the probability of an improper comparator output).
What is needed, therefore, is an improved differential input comparator having symmetrical hysteresis and capable of operating independently of a DC voltage supply level.